This invention relates to a virtual computer system realized in a server system, and more particularly, to a virtual computer system enabling higher efficiency of hardware emulation carried out by a virtual machine monitor.
As an operation becomes more complex along with an increase in the number of servers included in an IT system, operation costs become a problem. To reduce the operation costs, server integration which integrates a plurality of servers into one server has been known. As a technique for realizing the server integration, a virtual computer technique which logically divides one computer at an optional ratio has been known.
According to the virtual computer technique, for example, firmware or middleware, such as a hypervisor, divides a physical computer into a plurality of logical partitions (LPAR), and allocates computer resources (CPU, main memory, and I/O) to each divided LPAR. An operating system (OS) is operated on this LPAR. Additionally, one host OS (OS which directly uses the physical computer) is executed in one server, and a hypervisor operated on the host OS similarly divides the physical computer into LPAR's. A guest OS (OS operated on LPAR) may be operated on each LPAR.
Thus, the virtual computer technique enables an OS conventionally operated in a plurality of servers and software operated on the OS to be operated in one server. Accordingly, the server integration is realized.
The virtual computer technique is a technique conventionally used in a large computer such as a mainframe. With a recent increase in performance of a microprocessor, however, the virtual computer technique can be applied to a low-end server or a personal computer.
By applying the virtual computer technique, the physical computer constitutes a virtual computer system which includes a plurality of virtual machines for operating a guest (generic term of guest OS and application software operated on the guest OS) and a virtual machine monitor (referred to as VMM hereinafter) for controlling the virtual machines (refer to U.S. Pat. No. 6,397,242).
The OS is originally prepared on the premise of exclusively using all pieces of hardware of the server. A plurality of guest OS's are operated in the virtual computer system. However, the guest OS cannot exclusively use the hardware of the server. Accordingly, the VMM emulates the same activity as that in a state where the guest OS monopolizes the hardware of the server, corresponding to a hardware operation by the guest OS.
The VMM uses time and memory for the emulation processing. Thus, when a number of emulation times by the VMM is increased by the guest OS, processing time and an amount of used memory increase to deteriorate guest performance, creating a problem of a reduction in a memory amount usable by the guest. To mitigate the problem, a technique of achieving high-speed emulation (high performance) and a memory saving technique have been invented.
One of the high-speed emulation technique is a code conversion system. According to the code conversion system, the VMM creates a conversion code corresponding to an operation code (or OS code) of the guest OS in the memory. The conversion code creation processing is called code conversion. When the conversion code is created, a hardware operation included in the corresponding OS code is replaced with an emulation code. According to the code conversion system, by executing the code conversion in place of the OS code, the hardware operation can be emulated with minimum necessary processing. The code conversion system executes code conversion for all the OS codes necessary for execution. The code conversion may cause a speed reduction as it requires processing time. Thus, according to this system, the speed reduction is prevented by continuously holding the created conversion code in the memory and reusing the conversion code of the memory from second time and after. However, when the memory for holding the conversion code becomes short, conversion codes of a low execution frequency are discarded as all the conversion codes cannot be held therein.
A virtualization technology (referred to as VT hereinafter) system that is a memory saving emulation technique uses a VT function mounted on a CPU made by Intel Corporation. When the VT function is used, a hardware operation full-inhibition mode which inhibits execution of all hardware operation codes can be selected as a CPU operation mode. When execution of the hardware operation codes is tried while the CPU is in the hardware operation full-inhibition mode, the CPU generates an exception event to forcibly interrupt the code execution. In this case, the CPU shifts to a hardware operation permission mode which permits the hardware operation to execute codes registered beforehand. On the other hand, when resumption processing from the exception event is executed in the hardware operation permission mode, the CPU shifts to the hardware operation full-inhibition mode to resume execution from a designated address (refer to Intel Itanium Architecture Software Developer's Manual Volume 2, and Intel 64 and IA-32 Architecture Software Developer's Manual Volume 3).
According to this system, an emulation module for executing the emulation processing is registered in the CPU beforehand, and the guest is executed in the hardware operation full-inhibition mode to emulate the hardware operation. In this system, as the memory of the VMM holds only the emulation module and data used for the emulation, a memory use amount of the VMM is small.